<template>
  <div>
    <div>
      <van-cell title="修改密码" is-link to="/user/changepsw" />
      <van-cell title="重置密码" is-link to="/user/resetpsw" />
      <van-cell title="关于国医" is-link @click.native="handleAbout" />
      <van-cell
        title="切换身份"
        :value="isEmployee"
        is-link
        @click.native="handleAbout"
      />

      <van-button type="primary" @click.native="handleLogout">
        退出登录
      </van-button>

      <div>
        <!-- {{ partner }} -->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'MeConsultant',
  components: {},
  directives: {},
  filters: {},
  // mixins: [],
  props: {},

  data() {
    return {}
  },
  computed: {
    isEmployee: function() {
      return this.$store.state.user.isEmployee ? '大夫' : '患者'
    }
  },
  async created() {},

  methods: {
    handleChangePsw() {
      console.log('xxx, click handleChangePsw,')
    },
    handleAbout() {
      console.log('xxx, click  about,')
    },
    async handleLogout() {
      console.log('xxx,handleLogout')
      await this.$store.dispatch('user/logout')
      console.log('xxx,handleLogout 2')
      this.$router.push('/login')
    }
  }
}
</script>

<style type="text/css"></style>
